<template>
   <div>
     <h2>我是用户界面</h2>
     <p>传过来的用户参数是：{{userId}}</p>
   </div>
</template>

<script>
    export default {
        name: "User",
        computed:{
            userId(){
                //$route:当前活跃的路由地址
                //$router：路由对象
                return this.$route.params.userId
            }
        },
        watch:{
            '$route'(to,from){
                console.log(to);
                console.log(from);
            }

        }
    }
</script>

<style scoped>

</style>
